Linear Combinations
Lecture 3
Recap
$$ % Colors
% Coordinate vectors and matrices
% Common sets
% Abstract vector symbols
% Norms / absolute value
% Optional: dot product spacing (looks nicer in slides)
% Operators $$
Vectors and linear combinations
- A vector describes a direction together with a magnitude. It can be written as \[\vec{v} = \langle a_1, a_2, \dots, a_n \rangle \in \mathbb{R}^n\] or equivalently in column vector form.
- A scalar describes a (signed) magnitude and is denoted by \(c \in \mathbb{R}\).
- A linear combination of vectors \(\vec{v}_1, \dots, \vec{v}_k\) is a vector of the form \[\vec{u} = c_1 \vec{v}_1 + \dots + c_k \vec{v}_k = \sum_{i=1}^k c_i \vec{v}_i,\] where the coefficients \(c_i \in \mathbb{R}\).
- The Cartesian coordinate system is a fundamental example of linear combinations: every vector in \(\mathbb{R}^n\) can be written as a linear combination of the unit coordinate vectors (later called the standard basis vectors).
- Explicitly, \[\begin{bmatrix} a_1 \\ a_2 \\ \vdots \\ a_n \end{bmatrix} = a_1 \vec{e}_1 + a_2 \vec{e}_2 + \dots + a_n \vec{e}_n,\quad \vec{e}_i = \begin{aligned} \left[ \begin{array}{c} 0 \\ \vdots \\ 1 \\ \vdots \\ 0 \end{array} \right] &\;\leftarrow\; \substack{i\text{-th} \\ \text{position}} \end{aligned}.\]
Examples
- Let \(\vec{v} = \langle -1, 2 \rangle\), \(\vec{u} = \langle 1, 1 \rangle\), and \(\vec{w} = \langle 0, 3 \rangle\). Find \[3\vec{v} - \vec{u} - 2\vec{w}.\]
- Let \(\vec{v} = \langle 2, 0, 6 \rangle\) and \(\vec{u} = \langle 1, 1, -2 \rangle\). Find \[\frac{1}{2}\vec{v} + \vec{u}.\]
- Discuss your answers with classmates.
Answers
\(\langle -4, -1 \rangle\).
\(\langle 2, 1, 1 \rangle\).
Matrix Notation and Linear Combination
Notational convention
- Linear algebra involves many variables and indices.
- Establishing a clear convention early helps reduce confusion.
- We typically use \(n\) for the dimension of the space where vectors live (later, we may use \(m\) or \(k\) for dimensions of multiple spaces).
Notational convention (continued)
- We often write \[\vec{{\color{\orange} v}} = \begin{bmatrix} {\color{\orange} v}_1 \\ {\color{\orange} v}_2 \\ \vdots \\ {\color{\orange} v}_n \end{bmatrix}\] to indicate that the real number \({\color{\orange} v}_{{\color{\red} i}}\) is the \({\color{\red} i}\)-th coordinate of the vector \(\vec{{\color{\orange} v}}\).
Notational convention (continued)
- When working with multiple vectors, we write \(\vec{v}_1, \vec{v}_2, \dots, \vec{v}_k\), where \(\vec{v}_{{\color{\green} j}}\) denotes the \({\color{\green} j}\)-th vector.
- The coordinates of \(\vec{v}_{{\color{\green} j}}\) are written as \(\langle v_{1{\color{\green} j}}, v_{2{\color{\green} j}}, \dots, v_{n{\color{\green} j}} \rangle\), so that \(v_{{\color{\red} i}{\color{\green} j}}\) denotes the \({\color{\red} i}\)-th coordinate of the \({\color{\green} j}\)-th vector.
Example
- Let \(\vec{v}_1 = \langle -1, 2 \rangle\), \(\vec{v}_2 = \langle 1, 1 \rangle\), and \(\vec{v}_3 = \langle 0, 3 \rangle\).
- What is \(v_{12}\)?
Answer: 1 (the first coordinate of the second vector).
Scan the QR code or go to join.iclicker.com/MBNJ.
Block notation
- We use a matrix to encode the information of multiple vectors.
- Recall that we represent vectors as column vectors (vertical stacks).
- To record \(k\) vectors, we place \(k\) column vectors side by side (each column is a “block”): \[\begin{bmatrix}\vec{v}_1 & \vec{v}_2 & \cdots & \vec{v}_k\end{bmatrix} = \begin{bmatrix}\boxed{\begin{array}{c} v_{11} \\ \vdots \\ v_{n1} \end{array}} & \boxed{\begin{array}{c} v_{12} \\ \vdots \\ v_{n2} \end{array}} & \cdots & \boxed{\begin{array}{c} v_{1k} \\ \vdots \\ v_{nk} \end{array}}\end{bmatrix}.\]
Block notation (continued)
- We call \(\begin{bmatrix}\vec{v}_1 & \vec{v}_2 & \cdots & \vec{v}_k\end{bmatrix}\) a block notation, since each \(\vec{v}_j\) is treated as a column block.
- The resulting array has \(n\) rows and \(k\) columns: \[ \begin{bmatrix} \boxed{\begin{array}{c} v_{11} \\ \vdots \\ v_{n1} \end{array}} & \boxed{\begin{array}{c} v_{12} \\ \vdots \\ v_{n2} \end{array}} & \cdots & \boxed{\begin{array}{c} v_{1k} \\ \vdots \\ v_{nk} \end{array}} \end{bmatrix} \] and is called an \(n \times k\) matrix.
- The boxes are drawn only to emphasize that each column forms a vector; in practice, matrices are written without boxes. Still, always keep in mind that each column represents a vector.
Tips for notation
- Many people (including younger me 🙂) get confused about whether an \(n \times k\) matrix has \(n\) rows and \(k\) columns, or \(k\) rows and \(n\) columns.
- Remember: vectors are always written as column vectors, and an \(n \times k\) matrix represents \(k\) vectors in \(\mathbb{R}^n\).
- The first number \(n\) indicates the dimension of the space where the vectors live.
- The second number \(k\) indicates how many vectors there are.
- Since vectors are written as columns, \(n\) corresponds to the number of rows.
- Since vectors are placed side by side in block form, \(k\) corresponds to the number of columns.
Matrix and Linear Combination
- A matrix is a convenient tool for representing linear combinations of vectors.
- Recall that \[ \vec{w} = c_1\vec{v}_1 + \cdots + c_k \vec{v}_k \] is a linear combination of the vectors \(\vec{v}_1,\dots,\vec{v}_k \in \mathbb{R}^n\).
- Writing this componentwise, the \(i\)-th entry of \(\vec{w}\) is \[ w_i = c_1 v_{i1} + c_2 v_{i2} + \cdots + c_k v_{ik}, \] where \(v_{ij}\) denotes the \(i\)-th entry of the vector \(\vec{v}_j\).
- Let us organize the vectors \(\vec{v}_1,\dots,\vec{v}_k\) as columns of a matrix, and the scalars \(c_1,\dots,c_k\) as a column vector: \[ \begin{bmatrix} v_{11} & v_{12} & \cdots & v_{1k} \\ v_{21} & v_{22} & \cdots & v_{2k} \\ \vdots & \vdots & \ddots & \vdots \\ v_{n1} & v_{n2} & \cdots & v_{nk} \end{bmatrix} \begin{bmatrix} c_1 \\ c_2 \\ \vdots \\ c_k \end{bmatrix} \]
- Compare with \[ \begin{bmatrix} w_1 \\ w_2 \\ \vdots \\ w_n \end{bmatrix} = \begin{bmatrix} c_1v_{11} +c_2v_{12} + \cdots + c_kv_{1k} \\ c_1v_{21} +c_2v_{22} + \cdots + c_kv_{2k} \\ \vdots \\ c_1v_{n1} +c_2v_{n2} + \cdots + c_kv_{nk} \end{bmatrix}. \]
Matrix Multiplication
- We just saw the first version of matrix multiplication, where an \(n\times k\) matrix \[ A = [\,\vec{v}_1 \ \vec{v}_2 \ \cdots \ \vec{v}_k\,] \] is multiplied by a \(k\)-dimensional column vector \(\vec{c}\) (that is, a \(k\times 1\) matrix).
- The product \[ A\vec{c} \] should be interpreted as the linear combination of the column vectors of \(A\), with coefficients given by the entries of \(\vec{c}\): \[ A\vec{c} = c_1\vec{v}_1 + c_2\vec{v}_2 + \cdots + c_k\vec{v}_k. \]
Identity Matrix
- Recall the elementary linear combinations, where each vector is a unit coordinate vector \(\vec{e}_i\).
- In this case, the matrix formed by these vectors as columns is \[ \begin{bmatrix} 1 & 0 & \cdots & 0 \\ 0 & 1 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & 1 \end{bmatrix}. \]
- This matrix is called the \(n\times n\) identity matrix, and is denoted by \(I_n\).
- Multiplying by the identity matrix leaves a vector unchanged: \[ I_n \vec{c} = \vec{c}. \]
Examples (revisited)
Let \(\vec{v}_1 = \langle -1, 2 \rangle\), \(\vec{v}_2 = \langle 1, 1 \rangle\), and \(\vec{v}_3 = \langle 0, 3 \rangle\). We compute \(3\vec{v}_1 - \vec{v}_2 - 2\vec{v}_3\) as before.
- The associated matrix (with vectors as columns) is \[ A = \begin{bmatrix} -1 & 1 & 0 \\ 2 & 1 & 3 \end{bmatrix}. \]
- The associated scalar vector is \[ \vec{c} = \begin{bmatrix} 3 \\ -1 \\ -2 \end{bmatrix}. \]
- The matrix multiplication gives \[ \begin{aligned} A\vec{c} &= \begin{bmatrix} -1 & 1 & 0 \\ 2 & 1 & 3 \end{bmatrix} \begin{bmatrix} 3 \\ -1 \\ -2 \end{bmatrix} \\[6pt] &= \begin{bmatrix} -1\cdot 3 + 1\cdot(-1) + 0\cdot(-2) \\ 2\cdot 3 + 1\cdot(-1) + 3\cdot(-2) \end{bmatrix} \\[6pt] &= \begin{bmatrix} -4 \\ -1 \end{bmatrix}. \end{aligned} \]
- Try the other example by yourself!
